function pdr=SnrToPdr (snr, length)
global f R B_N;
%ber=qfunc(sqrt ((snr*2 *B_N)/(R)));
%cdfnorn = normcdf(sqrt ((snr*2 *B_N)/(R)))
%snr
ber=1 - normcdf(sqrt ((snr*2 *B_N)/(R)))
pdr = realpow((1-ber), length)
end